Skip to main content

Set Reseller Level API

POST /setResellerLevel

Description

This API endpoint allows an admin to set or update the level or tier of an existing reseller by providing the reseller's ID and the desired level. The reseller's level can determine their permissions, access, and credit limits within the platform.

Request Body

The request utilizes GraphQL to perform the setResellerLevel mutation.

Mutation:

mutation setResellerLevel ($resellerId: Int!, $level: ResellerLevelName!) {
setResellerLevel (resellerId: $resellerId, level: $level) {
id
email
firstName
lastName
credit
level
phone
}
}

Variables:

{
"resellerId": 0,
"level": "<Reseller_Level>"
}
  • resellerId (Int): The unique identifier of the reseller whose level is being set.
  • level (ResellerLevelName Enum): The new level or tier to be assigned to the reseller. This could be a number from 1 to 10.

Response:

  • Success (200 OK):

    • If the level update is successful, the response will return the updated reseller's details, including their ID, email, and new level.
    {
    "data": {
    "setResellerLevel": {
    "id": "<Reseller_ID>",
    "email": "<Reseller_Email>",
    "firstName": "<First_Name>",
    "lastName": "<Last_Name>",
    "credit": "<Credit_Amount>",
    "level": "<Reseller_Level>",
    "phone": "<Phone_Number>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid reseller ID, missing required fields, or server errors.

Note:

Ensure that the resellerId corresponds to an existing reseller whose level is being updated. The level should be a valid and recognized tier within the platform. This API should be used by admins with the necessary permissions to manage reseller accounts and levels.